furny.furndb.importer
Class RenderThumbnailState

java.lang.Object
  extended by com.jme3.app.state.AbstractAppState
      extended by furny.jme.appstate.RootNodeState
          extended by furny.furndb.importer.RenderThumbnailState
All Implemented Interfaces:
com.jme3.app.state.AppState

public class RenderThumbnailState
extends RootNodeState

This test renders a scene to a thumbnail, which can be stored as image or in a database.


Nested Class Summary
static interface RenderThumbnailState.RenderListener
          Interface for an render listener.
 class RenderThumbnailState.RenderToImageProcessor
          This is a processor, that renders scenes to a java.awt.Image.
 
Field Summary
private  FurnyApplication app
           
private  com.jme3.renderer.Camera cam
           
private  com.jme3.scene.Node camTarget
           
private  boolean captureNextFrame
           
private  com.jme3.input.ChaseCamera chaseCam
           
private  boolean doRender
           
private  boolean doSave
           
private  java.lang.String fileName
           
private  java.lang.String id
           
static java.awt.Dimension IMAGE_SIZE
           
private  boolean initialized
           
private static java.util.logging.Logger LOGGER
           
private  com.jme3.scene.Node modelNode
           
private  RenderThumbnailState.RenderListener outterListener
           
private  int renderCycles
           
private  com.jme3.renderer.RenderManager rm
           
private  RenderThumbnailState.RenderToImageProcessor state
           
private  com.jme3.renderer.ViewPort viewPort
           
 
Fields inherited from class furny.jme.appstate.RootNodeState
rootNode
 
Constructor Summary
RenderThumbnailState()
          Creates a new state, doing no initialization.
 
Method Summary
 void cleanup()
           
 void initialize(com.jme3.app.state.AppStateManager stateManager, com.jme3.app.Application app)
           
 boolean isInitialized()
           
 void render(com.jme3.renderer.RenderManager rm)
           
 void renderThumbnail(java.lang.String id, com.jme3.scene.Node node, RenderThumbnailState.RenderListener listener)
          This method triggers the rendering of a node to an java.awt.Image.
 void setRenderImage(boolean render)
          Sets the property doRender.
 void setSaveImage(boolean save)
          Sets the property doSave.
 void stateAttached(com.jme3.app.state.AppStateManager stateManager)
           
 void stateDetached(com.jme3.app.state.AppStateManager stateManager)
           
 
Methods inherited from class furny.jme.appstate.RootNodeState
getRootNode, update
 
Methods inherited from class com.jme3.app.state.AbstractAppState
isEnabled, postRender, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMAGE_SIZE

public static final java.awt.Dimension IMAGE_SIZE

LOGGER

private static final java.util.logging.Logger LOGGER

outterListener

private RenderThumbnailState.RenderListener outterListener

chaseCam

private com.jme3.input.ChaseCamera chaseCam

cam

private com.jme3.renderer.Camera cam

camTarget

private com.jme3.scene.Node camTarget

modelNode

private com.jme3.scene.Node modelNode

id

private java.lang.String id

state

private RenderThumbnailState.RenderToImageProcessor state

renderCycles

private int renderCycles

captureNextFrame

private boolean captureNextFrame

doRender

private boolean doRender

doSave

private boolean doSave

initialized

private boolean initialized

fileName

private java.lang.String fileName

app

private FurnyApplication app

viewPort

private com.jme3.renderer.ViewPort viewPort

rm

private com.jme3.renderer.RenderManager rm
Constructor Detail

RenderThumbnailState

public RenderThumbnailState()
Creates a new state, doing no initialization. The initialization is done when this state is attached to the state manager.

Since:
26.06.2011
Method Detail

stateAttached

public void stateAttached(com.jme3.app.state.AppStateManager stateManager)
Specified by:
stateAttached in interface com.jme3.app.state.AppState
Overrides:
stateAttached in class com.jme3.app.state.AbstractAppState

stateDetached

public void stateDetached(com.jme3.app.state.AppStateManager stateManager)
Specified by:
stateDetached in interface com.jme3.app.state.AppState
Overrides:
stateDetached in class com.jme3.app.state.AbstractAppState

render

public void render(com.jme3.renderer.RenderManager rm)
Specified by:
render in interface com.jme3.app.state.AppState
Overrides:
render in class com.jme3.app.state.AbstractAppState

initialize

public void initialize(com.jme3.app.state.AppStateManager stateManager,
                       com.jme3.app.Application app)
Specified by:
initialize in interface com.jme3.app.state.AppState
Overrides:
initialize in class com.jme3.app.state.AbstractAppState

renderThumbnail

public void renderThumbnail(java.lang.String id,
                            com.jme3.scene.Node node,
                            RenderThumbnailState.RenderListener listener)
This method triggers the rendering of a node to an java.awt.Image.

Parameters:
id - The id will be used to identify the node by the render listener when it is rendered
node - The node to render
listener - The listener that will receive events when the rendering is done
Since:
26.06.2011

setRenderImage

public void setRenderImage(boolean render)
Sets the property doRender. If doRender is true, an java.awt.Image will be rendered from the node.

Parameters:
render - Render image or not.
Since:
26.06.2011

setSaveImage

public void setSaveImage(boolean save)
Sets the property doSave. If doSave is true, the image will be saved as file. The filename is identified by the id of the node.

Parameters:
save - Save as file or not.
Since:
26.06.2011

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface com.jme3.app.state.AppState
Overrides:
isInitialized in class com.jme3.app.state.AbstractAppState

cleanup

public void cleanup()
Specified by:
cleanup in interface com.jme3.app.state.AppState
Overrides:
cleanup in class com.jme3.app.state.AbstractAppState